package com.xuetang9.t9.hotel.services.impl;

import com.xuetang9.t9.hotel.beans.Arranging;
import com.xuetang9.t9.hotel.mapper.ArrangingMapper;
import com.xuetang9.t9.hotel.mapper.IArriveMapper;
import com.xuetang9.t9.hotel.services.IArrangingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArrangingServiceImpl implements IArrangingService {

    @Autowired
    private ArrangingMapper arriveMapper;


    @Override
    public int save(Arranging arranging) {
        return arriveMapper.insert(arranging);
    }

    @Override
    public int remove(Integer id) {
        return arriveMapper.delete(id);
    }

    @Override
    public int update(Arranging arranging) {
        return arriveMapper.update(arranging);
    }

    @Override
    public List<Arranging> selectByAll(Integer currPage, Integer pageSize) {
        return arriveMapper.selectByAll((currPage - 1)*pageSize,pageSize);
    }

    @Override
    public List<Arranging> selectByTodayAll() {

        return arriveMapper.selectByTodayAll();
    }

    @Override
    public Long selectByCount() {
        return arriveMapper.selectByCount();
    }
}
